<%@page contentType="text/html;charset=utf-8" %>
<%@taglib prefix="s" uri="/struts-tags" %> 
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="5"></td>
    <td>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="<s:property value="%{getQueryDimensionCount(dimension)+2}"/>">
       <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="images/table_top_left.jpg" width="20" height="15" /></td>
            <td><img src="images/table_top_bg.jpg" width="770" height="15"/></td>
            <td align="right"><img src="images/table_top_right.jpg" width="20" height="15" /></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="25" colspan="<s:property value="%{getQueryDimensionCount(dimension)+2}"/>" 
        class="table_blue">　<strong><img src="images/dot.jpg" width="13" height="9">查询结果</strong></td>
    </tr> 
    <s:if test="hasActionErrors()"> 
    <tr>
      <td class="table_w1" colspan="<s:property value="%{getQueryDimensionCount(dimension)+2}"/>" align="center">
        <strong><font color="red"><s:actionerror /></font></strong>
      </td>
    </tr>
    </s:if>
    <tr>
    <td>
    <table id="sort_table" width="100%" border="0" cellspacing="0" cellpadding="0"
           style="word-break:break-all;">
    <tr>
      <td align="center" class="table_g1" width="5%">序号</td>
      <s:if test="%{checkQueryDimension(dimension,'day')}">
      <td align="center" class="table_g2" width="5%">日期</td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'hour')}">
      <td align="center" class="table_g2" width="5%">小时</td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'minute')}">
      <td align="center" class="table_g2" width="5%">分钟</td></s:if>
      
       <s:if test="%{checkQueryDimension(dimension,'carrier')}">
      <td align="center" class="table_g2" width="5%">运营商</td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'channel')}">
      <td align="center" class="table_g2" width="5%">渠道</td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'project')}">
      <td align="center" class="table_g2" width="5%">项目</td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'province')}">
      <td align="center" class="table_g2" width="5%">省份</td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'region')}">
      <td align="center" class="table_g2" width="5%">地区</td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'cpid')}">
      <td align="center" class="table_g2" width="5%">CP</td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'appid')}">
      <td align="center" class="table_g2" width="5%">应用</td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'goodscode')}">
      <td align="center" class="table_g2" width="5%">产品编号-产品名称</td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'chid')}">
      <td align="center" class="table_g2" width="5%">chid</td></s:if>
       <s:if test="%{checkQueryDimension(dimension,'sdkid')}">
      <td align="center" class="table_g2" width="5%">SDK</td></s:if>
      
      <td align="center" class="table_g2" width="5%">订单数</td>
      <td align="center" class="table_g2" width="5%">下发数</td>
      <td align="center" class="table_g2" width="5%">状态数</td>
      <td align="center" class="table_g2" width="5%">成功数</td>
      <td align="center" class="table_g2" width="5%">请求金额</td>
      <td align="center" class="table_g2" width="5%">下发金额</td>
      <td align="center" class="table_g2" width="5%">成功金额</td>
    </tr>
    <tbody id="sort_body">
    <s:if test="list.size()>0" >
    <s:set var="totalcount" value="0" />
    <s:set var="totalissuedcount" value="0" />
    <s:set var="totalresultcount" value="0" />
    <s:set var="totalsucc" value="0" />
    <s:set var="totalfeevalue" value="0" />
    <s:set var="totalrequestfee" value="0" />
    <s:set var="totalsuccessfee" value="0" />
    <s:iterator value="list" status="stat1" >    
    <tr onmouseover="this.style.background='#c0c0c0';" 
        onmouseout="this.style.background='#ffffff';" >
      <td class="table_w1" align="center"><s:property value="#stat1.index+1" /></td>
      <s:if test="%{checkQueryDimension(dimension,'day')}">
      <td class="table_w2" align="center"><s:property value="day" /></td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'hour')}">
      <td class="table_w2" align="center"><s:property value="hour" /></td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'minute')}">
      <td class="table_w2" align="center"><s:property value="(minute*10)+'~'+((minute+1)*10-1)" /></td></s:if>
      
       <s:if test="%{checkQueryDimension(dimension,'carrier')}">
      <td class="table_w2" align="center"><s:property value="%{getConstantString('carrier', carrier)}" /></td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'channel')}">
      <td class="table_w2" align="center"><s:property value="%{getChannelName(channel)}" /></td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'project')}">
      <td class="table_w2" align="center"><s:property value="%{getProjectName(project)}" /></td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'province')}">
      <td class="table_w2" align="center"><s:property value="%{getProvince(province).name}" /></td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'region')}">
      <td class="table_w2" align="center"><s:property value="%{getRegion(province, region).name}" /></td></s:if>
      
      
      <s:if test="%{checkQueryDimension(dimension,'cpid')}">
      <td class="table_w2" align="center"><s:property value="%{getCpName(cpid)}" /></td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'appid')}">
      <td class="table_w2" align="center"><s:property value="%{getAppName(appid)}" /></td></s:if>
     <s:if test="%{checkQueryDimension(dimension,'goodscode')}">
      <td class="table_w2" align="center"><s:property value="goodscode" />-<s:property value="goodsname" /></td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'chid')}">
      <td class="table_w2" align="center"><s:property value="chid" /></td></s:if>
      <s:if test="%{checkQueryDimension(dimension,'sdkid')}">
      <td class="table_w2" align="center"><s:property value="%{getSdkName(sdkid)}" /></td></s:if>
      
      <td class="table_w2" align="center"><s:property value="count" /></td>
      <td class="table_w2" align="center"><s:property value="issuedcount" /></td>
      <td class="table_w2" align="center"><s:property value="resultcount" /></td>
      <td class="table_w2" align="center"><s:property value="succ" /></td>
      <td class="table_w2" align="center"><s:property value="requestfee/100" /></td>
      <td class="table_w2" align="center"><s:property value="feevalue/100" /></td>
      <td class="table_w2" align="center"><s:property value="successfee/100" /></td>
      <s:set var="totalcount" value="#totalcount=#totalcount+count" />
      <s:set var="totalissuedcount" value="#totalissuedcount=#totalissuedcount+issuedcount" />
      <s:set var="totalresultcount" value="#totalresultcount=#totalresultcount+resultcount" />
      <s:set var="totalsucc" value="#totalsucc=#totalsucc+succ" />
      <s:set var="totalfeevalue" value="#totalfeevalue=#totalfeevalue+feevalue" />
      <s:set var="totalsuccessfee" value="#totalsuccessfee=#totalsuccessfee+successfee" />
      <s:set var="totalrequestfee" value="#totalrequestfee=#totalrequestfee+requestfee" />
    </tr>
    </s:iterator>
    <tr bgcolor="#c0c0f0">
      <td class="table_w1" align="center" colspan="<s:property value="%{getQueryDimensionCount(dimension)+1}"/>">合计</td>
      <td class="table_w2" align="center"><s:property value="#totalcount" /></td>
      <td class="table_w2" align="center"><s:property value="#totalissuedcount" /></td>
      <td class="table_w2" align="center"><s:property value="#totalresultcount" /></td>
      <td class="table_w2" align="center"><s:property value="#totalsucc" /></td>
      <td class="table_w2" align="center"><s:property value="#totalrequestfee/100" /></td>
      <td class="table_w2" align="center"><s:property value="#totalfeevalue/100" /></td>
      <td class="table_w2" align="center"><s:property value="#totalsuccessfee/100" /></td>
      
    </tr>
    </s:if>
    <s:else>    
    <tr>
      <td class="table_w1" align="center" colspan="<s:property value="%{getQueryDimensionCount(dimension)+5}"/>">无</td>
    </tr>
    </s:else>
    </tbody>
    </table>
    </td>
    </tr>
    <tr> 
      <td colspan="<s:property value="%{getQueryDimensionCount(dimension)+2}"/>" background="images/table_bom_bg.jpg">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="images/table_bom_left.jpg" width="20" height="15"></td>
          <td></td>
          <td align="right"><img src="images/table_bom_right.jpg" width="20" height="15"></td>
        </tr>
        </table>
      </td>
    </tr>
  </table>  
  </td>
  <td width="5"></td>
  </tr>
  </table>